3.66 \(\int (c+d \tan (e+f x))^3 (A+B \tan (e+f x)+C \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=191 \[ \frac{d \tan (e+f x) \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )}{f}-\frac{\left (d (A-C) \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f}-x \left (-A \left (c^3-3 c d^2\right )+3 B c^2 d-B d^3+c^3 C-3 c C d^2\right )+\frac{(d (A-C)+B c) (c+d \tan (e+f x))^2}{2 f}+\frac{B (c+d \tan (e+f x))^3}{3 f}+\frac{C (c+d \tan (e+f x))^4}{4 d f} \]

[Out]

-((c^3*C + 3*B*c^2*d - 3*c*C*d^2 - B*d^3 - A*(c^3 - 3*c*d^2))*x) - (((A - C)*d*(3*c^2 - d^2) + B*(c^3 - 3*c*d^
2))*Log[Cos[e + f*x]])/f + (d*(2*c*(A - C)*d + B*(c^2 - d^2))*Tan[e + f*x])/f + ((B*c + (A - C)*d)*(c + d*Tan[
e + f*x])^2)/(2*f) + (B*(c + d*Tan[e + f*x])^3)/(3*f) + (C*(c + d*Tan[e + f*x])^4)/(4*d*f)

________________________________________________________________________________________

Rubi [A]  time = 0.243865, antiderivative size = 191, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.121, Rules used = {3630, 3528, 3525, 3475} \[ \frac{d \tan (e+f x) \left (2 c d (A-C)+B \left (c^2-d^2\right )\right )}{f}-\frac{\left (d (A-C) \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f}-x \left (-A \left (c^3-3 c d^2\right )+3 B c^2 d-B d^3+c^3 C-3 c C d^2\right )+\frac{(d (A-C)+B c) (c+d \tan (e+f x))^2}{2 f}+\frac{B (c+d \tan (e+f x))^3}{3 f}+\frac{C (c+d \tan (e+f x))^4}{4 d f} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*Tan[e + f*x])^3*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

-((c^3*C + 3*B*c^2*d - 3*c*C*d^2 - B*d^3 - A*(c^3 - 3*c*d^2))*x) - (((A - C)*d*(3*c^2 - d^2) + B*(c^3 - 3*c*d^
2))*Log[Cos[e + f*x]])/f + (d*(2*c*(A - C)*d + B*(c^2 - d^2))*Tan[e + f*x])/f + ((B*c + (A - C)*d)*(c + d*Tan[
e + f*x])^2)/(2*f) + (B*(c + d*Tan[e + f*x])^3)/(3*f) + (C*(c + d*Tan[e + f*x])^4)/(4*d*f)

Rule 3630

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(C*(a + b*Tan[e + f*x])^(m + 1))/(b*f*(m + 1)), x] + Int[(a + b*Tan[e + f*x])
^m*Simp[A - C + B*Tan[e + f*x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0]
&&  !LeQ[m, -1]

Rule 3528

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(d
*(a + b*Tan[e + f*x])^m)/(f*m), x] + Int[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x
], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && GtQ[m, 0]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int (c+d \tan (e+f x))^3 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right ) \, dx &=\frac{C (c+d \tan (e+f x))^4}{4 d f}+\int (A-C+B \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx\\ &=\frac{B (c+d \tan (e+f x))^3}{3 f}+\frac{C (c+d \tan (e+f x))^4}{4 d f}+\int (c+d \tan (e+f x))^2 (A c-c C-B d+(B c+(A-C) d) \tan (e+f x)) \, dx\\ &=\frac{(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac{B (c+d \tan (e+f x))^3}{3 f}+\frac{C (c+d \tan (e+f x))^4}{4 d f}+\int (c+d \tan (e+f x)) \left (-c^2 C-2 B c d+C d^2+A \left (c^2-d^2\right )+\left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)\right ) \, dx\\ &=-\left (c^3 C+3 B c^2 d-3 c C d^2-B d^3-A \left (c^3-3 c d^2\right )\right ) x+\frac{d \left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac{(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac{B (c+d \tan (e+f x))^3}{3 f}+\frac{C (c+d \tan (e+f x))^4}{4 d f}+\left ((A-C) d \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \int \tan (e+f x) \, dx\\ &=-\left (c^3 C+3 B c^2 d-3 c C d^2-B d^3-A \left (c^3-3 c d^2\right )\right ) x-\frac{\left ((A-C) d \left (3 c^2-d^2\right )+B \left (c^3-3 c d^2\right )\right ) \log (\cos (e+f x))}{f}+\frac{d \left (2 c (A-C) d+B \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac{(B c+(A-C) d) (c+d \tan (e+f x))^2}{2 f}+\frac{B (c+d \tan (e+f x))^3}{3 f}+\frac{C (c+d \tan (e+f x))^4}{4 d f}\\ \end{align*}

Mathematica [C]  time = 2.41027, size = 212, normalized size = 1.11 \[ \frac{-6 (d (C-A)+B c) \left (6 c d^2 \tan (e+f x)+(-d+i c)^3 \log (-\tan (e+f x)+i)-(d+i c)^3 \log (\tan (e+f x)+i)+d^3 \tan ^2(e+f x)\right )+2 B \left (-6 d^2 \left (d^2-6 c^2\right ) \tan (e+f x)+12 c d^3 \tan ^2(e+f x)+3 i (c-i d)^4 \log (\tan (e+f x)+i)-3 i (c+i d)^4 \log (-\tan (e+f x)+i)+2 d^4 \tan ^3(e+f x)\right )+3 C (c+d \tan (e+f x))^4}{12 d f} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*Tan[e + f*x])^3*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2),x]

[Out]

(3*C*(c + d*Tan[e + f*x])^4 - 6*(B*c + (-A + C)*d)*((I*c - d)^3*Log[I - Tan[e + f*x]] - (I*c + d)^3*Log[I + Ta
n[e + f*x]] + 6*c*d^2*Tan[e + f*x] + d^3*Tan[e + f*x]^2) + 2*B*((-3*I)*(c + I*d)^4*Log[I - Tan[e + f*x]] + (3*
I)*(c - I*d)^4*Log[I + Tan[e + f*x]] - 6*d^2*(-6*c^2 + d^2)*Tan[e + f*x] + 12*c*d^3*Tan[e + f*x]^2 + 2*d^4*Tan
[e + f*x]^3))/(12*d*f)

________________________________________________________________________________________

Maple [B]  time = 0.014, size = 420, normalized size = 2.2 \begin{align*}{\frac{C{d}^{3} \left ( \tan \left ( fx+e \right ) \right ) ^{4}}{4\,f}}+{\frac{B \left ( \tan \left ( fx+e \right ) \right ) ^{3}{d}^{3}}{3\,f}}+{\frac{C \left ( \tan \left ( fx+e \right ) \right ) ^{3}c{d}^{2}}{f}}+{\frac{A \left ( \tan \left ( fx+e \right ) \right ) ^{2}{d}^{3}}{2\,f}}+{\frac{3\,B \left ( \tan \left ( fx+e \right ) \right ) ^{2}c{d}^{2}}{2\,f}}+{\frac{3\,C \left ( \tan \left ( fx+e \right ) \right ) ^{2}{c}^{2}d}{2\,f}}-{\frac{C \left ( \tan \left ( fx+e \right ) \right ) ^{2}{d}^{3}}{2\,f}}+3\,{\frac{Ac{d}^{2}\tan \left ( fx+e \right ) }{f}}+3\,{\frac{B{c}^{2}d\tan \left ( fx+e \right ) }{f}}-{\frac{B{d}^{3}\tan \left ( fx+e \right ) }{f}}+{\frac{{c}^{3}C\tan \left ( fx+e \right ) }{f}}-3\,{\frac{cC{d}^{2}\tan \left ( fx+e \right ) }{f}}+{\frac{3\,\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) A{c}^{2}d}{2\,f}}-{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) A{d}^{3}}{2\,f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) B{c}^{3}}{2\,f}}-{\frac{3\,\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) Bc{d}^{2}}{2\,f}}-{\frac{3\,\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) C{c}^{2}d}{2\,f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) C{d}^{3}}{2\,f}}+{\frac{A\arctan \left ( \tan \left ( fx+e \right ) \right ){c}^{3}}{f}}-3\,{\frac{A\arctan \left ( \tan \left ( fx+e \right ) \right ) c{d}^{2}}{f}}-3\,{\frac{B\arctan \left ( \tan \left ( fx+e \right ) \right ){c}^{2}d}{f}}+{\frac{B\arctan \left ( \tan \left ( fx+e \right ) \right ){d}^{3}}{f}}-{\frac{C\arctan \left ( \tan \left ( fx+e \right ) \right ){c}^{3}}{f}}+3\,{\frac{C\arctan \left ( \tan \left ( fx+e \right ) \right ) c{d}^{2}}{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x)

[Out]

1/4/f*C*d^3*tan(f*x+e)^4+1/3/f*B*tan(f*x+e)^3*d^3+1/f*C*tan(f*x+e)^3*c*d^2+1/2/f*A*tan(f*x+e)^2*d^3+3/2/f*B*ta
n(f*x+e)^2*c*d^2+3/2/f*C*tan(f*x+e)^2*c^2*d-1/2/f*C*tan(f*x+e)^2*d^3+3/f*A*c*d^2*tan(f*x+e)+3/f*B*c^2*d*tan(f*
x+e)-1/f*B*d^3*tan(f*x+e)+1/f*c^3*C*tan(f*x+e)-3/f*c*C*d^2*tan(f*x+e)+3/2/f*ln(1+tan(f*x+e)^2)*A*c^2*d-1/2/f*l
n(1+tan(f*x+e)^2)*A*d^3+1/2/f*ln(1+tan(f*x+e)^2)*B*c^3-3/2/f*ln(1+tan(f*x+e)^2)*B*c*d^2-3/2/f*ln(1+tan(f*x+e)^
2)*C*c^2*d+1/2/f*ln(1+tan(f*x+e)^2)*C*d^3+1/f*A*arctan(tan(f*x+e))*c^3-3/f*A*arctan(tan(f*x+e))*c*d^2-3/f*B*ar
ctan(tan(f*x+e))*c^2*d+1/f*B*arctan(tan(f*x+e))*d^3-1/f*C*arctan(tan(f*x+e))*c^3+3/f*C*arctan(tan(f*x+e))*c*d^
2

________________________________________________________________________________________

Maxima [A]  time = 1.49359, size = 273, normalized size = 1.43 \begin{align*} \frac{3 \, C d^{3} \tan \left (f x + e\right )^{4} + 4 \,{\left (3 \, C c d^{2} + B d^{3}\right )} \tan \left (f x + e\right )^{3} + 6 \,{\left (3 \, C c^{2} d + 3 \, B c d^{2} +{\left (A - C\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} + 12 \,{\left ({\left (A - C\right )} c^{3} - 3 \, B c^{2} d - 3 \,{\left (A - C\right )} c d^{2} + B d^{3}\right )}{\left (f x + e\right )} + 6 \,{\left (B c^{3} + 3 \,{\left (A - C\right )} c^{2} d - 3 \, B c d^{2} -{\left (A - C\right )} d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 12 \,{\left (C c^{3} + 3 \, B c^{2} d + 3 \,{\left (A - C\right )} c d^{2} - B d^{3}\right )} \tan \left (f x + e\right )}{12 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

1/12*(3*C*d^3*tan(f*x + e)^4 + 4*(3*C*c*d^2 + B*d^3)*tan(f*x + e)^3 + 6*(3*C*c^2*d + 3*B*c*d^2 + (A - C)*d^3)*
tan(f*x + e)^2 + 12*((A - C)*c^3 - 3*B*c^2*d - 3*(A - C)*c*d^2 + B*d^3)*(f*x + e) + 6*(B*c^3 + 3*(A - C)*c^2*d
 - 3*B*c*d^2 - (A - C)*d^3)*log(tan(f*x + e)^2 + 1) + 12*(C*c^3 + 3*B*c^2*d + 3*(A - C)*c*d^2 - B*d^3)*tan(f*x
 + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.13902, size = 456, normalized size = 2.39 \begin{align*} \frac{3 \, C d^{3} \tan \left (f x + e\right )^{4} + 4 \,{\left (3 \, C c d^{2} + B d^{3}\right )} \tan \left (f x + e\right )^{3} + 12 \,{\left ({\left (A - C\right )} c^{3} - 3 \, B c^{2} d - 3 \,{\left (A - C\right )} c d^{2} + B d^{3}\right )} f x + 6 \,{\left (3 \, C c^{2} d + 3 \, B c d^{2} +{\left (A - C\right )} d^{3}\right )} \tan \left (f x + e\right )^{2} - 6 \,{\left (B c^{3} + 3 \,{\left (A - C\right )} c^{2} d - 3 \, B c d^{2} -{\left (A - C\right )} d^{3}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 12 \,{\left (C c^{3} + 3 \, B c^{2} d + 3 \,{\left (A - C\right )} c d^{2} - B d^{3}\right )} \tan \left (f x + e\right )}{12 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

1/12*(3*C*d^3*tan(f*x + e)^4 + 4*(3*C*c*d^2 + B*d^3)*tan(f*x + e)^3 + 12*((A - C)*c^3 - 3*B*c^2*d - 3*(A - C)*
c*d^2 + B*d^3)*f*x + 6*(3*C*c^2*d + 3*B*c*d^2 + (A - C)*d^3)*tan(f*x + e)^2 - 6*(B*c^3 + 3*(A - C)*c^2*d - 3*B
*c*d^2 - (A - C)*d^3)*log(1/(tan(f*x + e)^2 + 1)) + 12*(C*c^3 + 3*B*c^2*d + 3*(A - C)*c*d^2 - B*d^3)*tan(f*x +
 e))/f

________________________________________________________________________________________

Sympy [A]  time = 2.49255, size = 410, normalized size = 2.15 \begin{align*} \begin{cases} A c^{3} x + \frac{3 A c^{2} d \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 A c d^{2} x + \frac{3 A c d^{2} \tan{\left (e + f x \right )}}{f} - \frac{A d^{3} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{A d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac{B c^{3} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 B c^{2} d x + \frac{3 B c^{2} d \tan{\left (e + f x \right )}}{f} - \frac{3 B c d^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{3 B c d^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + B d^{3} x + \frac{B d^{3} \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac{B d^{3} \tan{\left (e + f x \right )}}{f} - C c^{3} x + \frac{C c^{3} \tan{\left (e + f x \right )}}{f} - \frac{3 C c^{2} d \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{3 C c^{2} d \tan ^{2}{\left (e + f x \right )}}{2 f} + 3 C c d^{2} x + \frac{C c d^{2} \tan ^{3}{\left (e + f x \right )}}{f} - \frac{3 C c d^{2} \tan{\left (e + f x \right )}}{f} + \frac{C d^{3} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{C d^{3} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac{C d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text{for}\: f \neq 0 \\x \left (c + d \tan{\left (e \right )}\right )^{3} \left (A + B \tan{\left (e \right )} + C \tan ^{2}{\left (e \right )}\right ) & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))**3*(A+B*tan(f*x+e)+C*tan(f*x+e)**2),x)

[Out]

Piecewise((A*c**3*x + 3*A*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) - 3*A*c*d**2*x + 3*A*c*d**2*tan(e + f*x)/f - A
*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + A*d**3*tan(e + f*x)**2/(2*f) + B*c**3*log(tan(e + f*x)**2 + 1)/(2*f) -
3*B*c**2*d*x + 3*B*c**2*d*tan(e + f*x)/f - 3*B*c*d**2*log(tan(e + f*x)**2 + 1)/(2*f) + 3*B*c*d**2*tan(e + f*x)
**2/(2*f) + B*d**3*x + B*d**3*tan(e + f*x)**3/(3*f) - B*d**3*tan(e + f*x)/f - C*c**3*x + C*c**3*tan(e + f*x)/f
 - 3*C*c**2*d*log(tan(e + f*x)**2 + 1)/(2*f) + 3*C*c**2*d*tan(e + f*x)**2/(2*f) + 3*C*c*d**2*x + C*c*d**2*tan(
e + f*x)**3/f - 3*C*c*d**2*tan(e + f*x)/f + C*d**3*log(tan(e + f*x)**2 + 1)/(2*f) + C*d**3*tan(e + f*x)**4/(4*
f) - C*d**3*tan(e + f*x)**2/(2*f), Ne(f, 0)), (x*(c + d*tan(e))**3*(A + B*tan(e) + C*tan(e)**2), True))

________________________________________________________________________________________

Giac [B]  time = 7.63522, size = 5805, normalized size = 30.39 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*tan(f*x+e))^3*(A+B*tan(f*x+e)+C*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/12*(12*A*c^3*f*x*tan(f*x)^4*tan(e)^4 - 12*C*c^3*f*x*tan(f*x)^4*tan(e)^4 - 36*B*c^2*d*f*x*tan(f*x)^4*tan(e)^4
 - 36*A*c*d^2*f*x*tan(f*x)^4*tan(e)^4 + 36*C*c*d^2*f*x*tan(f*x)^4*tan(e)^4 + 12*B*d^3*f*x*tan(f*x)^4*tan(e)^4
- 6*B*c^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 -
 2*tan(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 - 18*A*c^2*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*
x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 + 18*C*c^2*d*log(
4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*ta
n(e) + 1))*tan(f*x)^4*tan(e)^4 + 18*B*c*d^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) +
tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 + 6*A*d^3*log(4*(tan(e)^2 + 1)/
(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*
x)^4*tan(e)^4 - 6*C*d^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2
+ tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^4*tan(e)^4 - 48*A*c^3*f*x*tan(f*x)^3*tan(e)^3 + 48*C*c^3*f*x*t
an(f*x)^3*tan(e)^3 + 144*B*c^2*d*f*x*tan(f*x)^3*tan(e)^3 + 144*A*c*d^2*f*x*tan(f*x)^3*tan(e)^3 - 144*C*c*d^2*f
*x*tan(f*x)^3*tan(e)^3 - 48*B*d^3*f*x*tan(f*x)^3*tan(e)^3 + 18*C*c^2*d*tan(f*x)^4*tan(e)^4 + 18*B*c*d^2*tan(f*
x)^4*tan(e)^4 + 6*A*d^3*tan(f*x)^4*tan(e)^4 - 9*C*d^3*tan(f*x)^4*tan(e)^4 + 24*B*c^3*log(4*(tan(e)^2 + 1)/(tan
(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3
*tan(e)^3 + 72*A*c^2*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 +
 tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 - 72*C*c^2*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)
^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 - 72
*B*c*d^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 -
2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 - 24*A*d^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^
3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^3*tan(e)^3 + 24*C*d^3*log(4*(ta
n(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e)
+ 1))*tan(f*x)^3*tan(e)^3 - 12*C*c^3*tan(f*x)^4*tan(e)^3 - 36*B*c^2*d*tan(f*x)^4*tan(e)^3 - 36*A*c*d^2*tan(f*x
)^4*tan(e)^3 + 36*C*c*d^2*tan(f*x)^4*tan(e)^3 + 12*B*d^3*tan(f*x)^4*tan(e)^3 - 12*C*c^3*tan(f*x)^3*tan(e)^4 -
36*B*c^2*d*tan(f*x)^3*tan(e)^4 - 36*A*c*d^2*tan(f*x)^3*tan(e)^4 + 36*C*c*d^2*tan(f*x)^3*tan(e)^4 + 12*B*d^3*ta
n(f*x)^3*tan(e)^4 + 72*A*c^3*f*x*tan(f*x)^2*tan(e)^2 - 72*C*c^3*f*x*tan(f*x)^2*tan(e)^2 - 216*B*c^2*d*f*x*tan(
f*x)^2*tan(e)^2 - 216*A*c*d^2*f*x*tan(f*x)^2*tan(e)^2 + 216*C*c*d^2*f*x*tan(f*x)^2*tan(e)^2 + 72*B*d^3*f*x*tan
(f*x)^2*tan(e)^2 + 18*C*c^2*d*tan(f*x)^4*tan(e)^2 + 18*B*c*d^2*tan(f*x)^4*tan(e)^2 + 6*A*d^3*tan(f*x)^4*tan(e)
^2 - 6*C*d^3*tan(f*x)^4*tan(e)^2 - 36*C*c^2*d*tan(f*x)^3*tan(e)^3 - 36*B*c*d^2*tan(f*x)^3*tan(e)^3 - 12*A*d^3*
tan(f*x)^3*tan(e)^3 + 24*C*d^3*tan(f*x)^3*tan(e)^3 + 18*C*c^2*d*tan(f*x)^2*tan(e)^4 + 18*B*c*d^2*tan(f*x)^2*ta
n(e)^4 + 6*A*d^3*tan(f*x)^2*tan(e)^4 - 6*C*d^3*tan(f*x)^2*tan(e)^4 - 12*C*c*d^2*tan(f*x)^4*tan(e) - 4*B*d^3*ta
n(f*x)^4*tan(e) - 36*B*c^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)
^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 - 108*A*c^2*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*t
an(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2
 + 108*C*c^2*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x
)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 + 108*B*c*d^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*
tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 + 36*A*d^3*
log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x
)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 - 36*C*d^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e)
+ tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)^2*tan(e)^2 + 36*C*c^3*tan(f*x)^3*tan(e)^
2 + 108*B*c^2*d*tan(f*x)^3*tan(e)^2 + 108*A*c*d^2*tan(f*x)^3*tan(e)^2 - 144*C*c*d^2*tan(f*x)^3*tan(e)^2 - 48*B
*d^3*tan(f*x)^3*tan(e)^2 + 36*C*c^3*tan(f*x)^2*tan(e)^3 + 108*B*c^2*d*tan(f*x)^2*tan(e)^3 + 108*A*c*d^2*tan(f*
x)^2*tan(e)^3 - 144*C*c*d^2*tan(f*x)^2*tan(e)^3 - 48*B*d^3*tan(f*x)^2*tan(e)^3 - 12*C*c*d^2*tan(f*x)*tan(e)^4
- 4*B*d^3*tan(f*x)*tan(e)^4 + 3*C*d^3*tan(f*x)^4 - 48*A*c^3*f*x*tan(f*x)*tan(e) + 48*C*c^3*f*x*tan(f*x)*tan(e)
 + 144*B*c^2*d*f*x*tan(f*x)*tan(e) + 144*A*c*d^2*f*x*tan(f*x)*tan(e) - 144*C*c*d^2*f*x*tan(f*x)*tan(e) - 48*B*
d^3*f*x*tan(f*x)*tan(e) - 36*C*c^2*d*tan(f*x)^3*tan(e) - 36*B*c*d^2*tan(f*x)^3*tan(e) - 12*A*d^3*tan(f*x)^3*ta
n(e) + 24*C*d^3*tan(f*x)^3*tan(e) + 36*C*c^2*d*tan(f*x)^2*tan(e)^2 + 36*B*c*d^2*tan(f*x)^2*tan(e)^2 + 12*A*d^3
*tan(f*x)^2*tan(e)^2 - 12*C*d^3*tan(f*x)^2*tan(e)^2 - 36*C*c^2*d*tan(f*x)*tan(e)^3 - 36*B*c*d^2*tan(f*x)*tan(e
)^3 - 12*A*d^3*tan(f*x)*tan(e)^3 + 24*C*d^3*tan(f*x)*tan(e)^3 + 3*C*d^3*tan(e)^4 + 12*C*c*d^2*tan(f*x)^3 + 4*B
*d^3*tan(f*x)^3 + 24*B*c^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)
^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) + 72*A*c^2*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)
^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) - 72*C*c
^2*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*ta
n(f*x)*tan(e) + 1))*tan(f*x)*tan(e) - 72*B*c*d^2*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(
e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) - 24*A*d^3*log(4*(tan(e)^2 + 1
)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(
f*x)*tan(e) + 24*C*d^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 +
 tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1))*tan(f*x)*tan(e) - 36*C*c^3*tan(f*x)^2*tan(e) - 108*B*c^2*d*tan(f*x)^2*ta
n(e) - 108*A*c*d^2*tan(f*x)^2*tan(e) + 144*C*c*d^2*tan(f*x)^2*tan(e) + 48*B*d^3*tan(f*x)^2*tan(e) - 36*C*c^3*t
an(f*x)*tan(e)^2 - 108*B*c^2*d*tan(f*x)*tan(e)^2 - 108*A*c*d^2*tan(f*x)*tan(e)^2 + 144*C*c*d^2*tan(f*x)*tan(e)
^2 + 48*B*d^3*tan(f*x)*tan(e)^2 + 12*C*c*d^2*tan(e)^3 + 4*B*d^3*tan(e)^3 + 12*A*c^3*f*x - 12*C*c^3*f*x - 36*B*
c^2*d*f*x - 36*A*c*d^2*f*x + 36*C*c*d^2*f*x + 12*B*d^3*f*x + 18*C*c^2*d*tan(f*x)^2 + 18*B*c*d^2*tan(f*x)^2 + 6
*A*d^3*tan(f*x)^2 - 6*C*d^3*tan(f*x)^2 - 36*C*c^2*d*tan(f*x)*tan(e) - 36*B*c*d^2*tan(f*x)*tan(e) - 12*A*d^3*ta
n(f*x)*tan(e) + 24*C*d^3*tan(f*x)*tan(e) + 18*C*c^2*d*tan(e)^2 + 18*B*c*d^2*tan(e)^2 + 6*A*d^3*tan(e)^2 - 6*C*
d^3*tan(e)^2 - 6*B*c^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 +
 tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) - 18*A*c^2*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*ta
n(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 18*C*c^2*d*log(4*(tan(e)^2 + 1)/(tan(f*x)^
4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 18*B*c*d^2*log
(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*t
an(e) + 1)) + 6*A*d^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e) + tan(f*x)^2*tan(e)^2 +
tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) - 6*C*d^3*log(4*(tan(e)^2 + 1)/(tan(f*x)^4*tan(e)^2 - 2*tan(f*x)^3*tan(e)
 + tan(f*x)^2*tan(e)^2 + tan(f*x)^2 - 2*tan(f*x)*tan(e) + 1)) + 12*C*c^3*tan(f*x) + 36*B*c^2*d*tan(f*x) + 36*A
*c*d^2*tan(f*x) - 36*C*c*d^2*tan(f*x) - 12*B*d^3*tan(f*x) + 12*C*c^3*tan(e) + 36*B*c^2*d*tan(e) + 36*A*c*d^2*t
an(e) - 36*C*c*d^2*tan(e) - 12*B*d^3*tan(e) + 18*C*c^2*d + 18*B*c*d^2 + 6*A*d^3 - 9*C*d^3)/(f*tan(f*x)^4*tan(e
)^4 - 4*f*tan(f*x)^3*tan(e)^3 + 6*f*tan(f*x)^2*tan(e)^2 - 4*f*tan(f*x)*tan(e) + f)